package IO流;

import java.io.FileReader;
import java.io.IOException;

public class 字符输入流 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("C:\\Users\\gdq\\OneDrive\\桌面\\File文件夹\\aaa.txt");
        one(fr);
    }
    public static void one(FileReader fr) throws IOException {
        int a;
        while ((a = fr.read())!=-1){
            System.out.print((char) a);
        }
    }
    public static void two(FileReader fr) throws IOException {
        int len;
        char[] chars = new char[1024];
        while ((len = fr.read(chars))!=-1){
            for (int i = 0; i < len; i++) {
                System.out.print(chars[i]);
            }
        }
    }
}
